Genus: Making Generics Object-Oriented, Expressive, and Lightweight Technical Report

نویسندگان

  • Yizhou Zhang
  • Matthew C. Loring
  • Guido Salvaneschi
  • Barbara Liskov
  • Andrew C. Myers
چکیده

The support for generic programming in modern object-oriented programming languages is awkward and lacks desirable expressive power. We introduce an expressive genericity mechanism that adds expressive power and strengthens static checking, while remaining lightweight and simple in common use cases. Like type classes and concepts, the mechanism allows existing types to model type constraints retroactively. For expressive power, we expose models as named constructs that can be defined and selected explicitly to witness constraints; in common uses of genericity, however, types implicitly witness constraints without additional programmer effort. Models are integrated into the object-oriented style, with features like model generics, model-dependent types, model enrichment, model multimethods, constraint entailment, model inheritance, and existential quantification further extending expressive power in an object-oriented setting. We introduce the new genericity features and show that common generic programming idioms, including current generic libraries, can be expressed more precisely and concisely. The static semantics of the mechanism and a proof of a key decidability property are provided.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Generalising the BETA Type System

The type system of object-oriented programming languages should enable the description of models that originate from object-oriented analysis and design. In this paper, the BETA type system is generalised, resulting in direct language support for a number of new modelling aspects. The increased expressive power is obtained from a synergy between general block structure and the generalised type ...

متن کامل

Eco: A Flexible, Open and Type-Safe Framework for Aspect-Oriented Programming

In this report, we present the Eco aspect-oriented framework for Java. Eco’s main goals are a flexible and open design and allowing static type-checking. Eco realizes its flexibility and openness by employing a pure and well-designed object-oriented approach. Static type-checking is realized by exploiting the novel Java generics feature. In this report, we evaluate Eco with respect to these goa...

متن کامل

Transfer Report Wildcards, Variance and Virtual Classes

Wildcards are used in Java to soften the mismatch between parametric polymorphism (generics) and subtype polymorphism (inheritance). Java with wildcards has not been proven type sound (unlike generics) and so may include security holes that could affect nearly every program written in Java in the last few years (since wildcards are used extensively throughout the Java libraries). The bulk of th...

متن کامل

Technical Report STAR - TR - 00 - 02 An Efficient Class and Object Encoding ∗

An object encoding translates a language with object primitives to one without. Similarly, a class encoding translates classes into other primitives. Both are important theoretically for comparing the expressive power of languages and for transferring results from traditional languages to those with objects and classes. Both are also important foundations for the implementation of object-orient...

متن کامل

Lightweight 4x4 MDS Matrices for Hardware-Oriented Cryptographic Primitives

Linear diffusion layer is an important part of lightweight block ciphers and hash functions. This paper presents an efficient class of lightweight 4x4 MDS matrices such that the implementation cost of them and their corresponding inverses are equal. The main target of the paper is hardware oriented cryptographic primitives and the implementation cost is measured in terms of the required number ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016